package com.example.demoes.result;

import lombok.*;

@AllArgsConstructor
@ToString
@EqualsAndHashCode
@Data
@NoArgsConstructor
public class BusinessResponse {
    private boolean success;
    private String msg;
    private String code;
    private Object data;

    public static BusinessResponse success(Object data) {
        return new BusinessResponse(true,ErrorCode.SUCCESS.getMsg(),ErrorCode.SUCCESS.getCode(), data);
    }

    public static BusinessResponse fail(String msg) {
        return new BusinessResponse(false,msg,ErrorCode.ERROR.getCode(), null);
    }

}
